package com.tbit.main.dao.core;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tbit.main.pojo.StockMachine;
import com.tbit.main.pojo.VO.StockMachineVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Author: chen
 * @Description:
 * @Date: 创建于 16:32 2023/2/9
 */
public interface StockMachineMapper extends BaseMapper<StockMachine> {

    /**
     * 分页查询
     *
     * @param map
     * @return
     */
    List<StockMachineVO> queryPage(Map<String, Object> map);


    List<StockMachineVO> selectByWarehouseId(Map<String, Object> map);

    List<StockMachineVO> selectByWarehouseIdS(Map<String, Object> map);

    /**
     * 查询总数
     *
     * @param map
     * @return
     */
    Integer queryCount(Map<String, Object> map);

    /**
     * 获取区域扣押设备
     *
     * @param map
     * @return
     */
    List<StockMachine> getByAccountId(Map<String, Object> map);


    /**
     * 获取区域扣押设备
     *
     * @param map
     * @return
     */
    List<Integer> getAccountIdMachineId(Map<String, Object> map);

    /**
     * 获取区域车辆扣押设备
     *
     * @param map
     * @return
     */
    List<Integer> getAccountIdByMachineId(Map<String, Object> map);

    /**
     * 获取区域扣押设备
     *
     * @param map
     * @return
     */
    List<StockMachine> getByMachineId(Map<String, Object> map);


    /**
     * 根据车辆 id 统计数量
     * @param machineId 车辆 id
     * @return 数量
     */
    Integer countByMachineId(Integer machineId);

    /**
     * 查询车辆id集合中出入库车辆id
     *
     * @param machineIds 车辆id集合
     * @return
     */
    List<Integer> getExist(@Param("machineIds") List<Integer> machineIds);
}
